package com.feilx.changgou.goods.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.changgou.bean.PageVo;
import com.changgou.bean.Query;
import com.changgou.bean.QueryCondition;
import com.feilx.changgou.goods.dao.TbBrandDao;
import com.feilx.changgou.goods.service.TbBrandService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.changgou.pojo.TbBrandEntity;

import java.util.List;


@Service("tbBrandService")
public class TbBrandServiceImpl extends ServiceImpl<TbBrandDao, TbBrandEntity> implements TbBrandService {

    @Override
    public PageVo queryPage(QueryCondition params) {
        IPage<TbBrandEntity> page = this.page(
                new Query<TbBrandEntity>().getPage(params),
                new QueryWrapper<TbBrandEntity>()
        );

        return new PageVo(page);
    }

    @Override
    public List<TbBrandEntity> queryAll() {
        return this.list();
    }

    @Override
    public TbBrandEntity findById(Integer id) {
        return this.getById(id);
    }

}
